home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / util / cli / ECmd21p_bin.lha / ExtraCmds / doc / TestBits.man < prev    next >
Encoding:
Text File  |  1994-01-05  |  2.3 KB  |  67 lines

  1.  
  2.  
  3.  
  4. TestBits(V37)                                       TestBits(V37)
  5.  
  6.  
  7. FFOORRMMAATT
  8.        TTEESSTTBBIITTSS [NNAAMMEE] _f_i_l_e|_d_i_r_e_c_t_o_r_y [FFLLAAGGSS] _f_l_a_g_s
  9.  
  10. TTEEMMPPLLAATTEE
  11.        NNAAMMEE//AA,,FFLLAAGGSS//AA
  12.  
  13. PPUURRPPOOSSEE
  14.        To test whether one or more protection flags are set.
  15.  
  16. SSPPEECCIIFFIICCAATTIIOONN
  17.        TTEESSTTBBIITTSS  is  used  to to test the state of one or more of
  18.        the protection bits.  This can be useful in  scripts.  The
  19.        protection bits are represented by letters:
  20.        rr The file can be read.
  21.        ww The file can be written to.
  22.        ee The file is an executable program.
  23.        dd The file can be deleted.
  24.        ss The file is a script.
  25.        pp The file can be made resident.
  26.        aa The file has been archived.
  27.        If  a  letter is preceded by a `-', it means that in order
  28.        to match, the corresponding file  bit  must  _n_o_t  be  set.
  29.        Whitespace is not allowed between the letters representing
  30.        the bits. If the state of all the bits given in the  _f_l_a_g_s
  31.        argument  match  the file's protection bits, TTEESSTTBBIITTSS sets
  32.        the condition flag to 5 (WARN), otherwise it is set to  0.
  33.        To check the response, an IIFF statement can be used.
  34.  
  35. EEXXAAMMPPLLEE
  36.        The following script will test whether or not its argument
  37.        is a script:
  38.            .KEY myfile/A
  39.            TESTBITS <myfile> s
  40.            IF WARN
  41.              ECHO <myfile> is a script
  42.            ELSE
  43.              ECHO <myfile> is not a script
  44.            ENDIF
  45.  
  46. SSEEEE AALLSSOO
  47.        FFIINNDD(V37), IIFF(AmigaDOS), PPRROOTTEECCTT(AmigaDOS)
  48.  
  49. AAUUTTHHOORR
  50.        Torsten Poulin (torsten@diku.dk)
  51.  
  52. UUNNRREESSTTRRIICCTTIIOONNSS
  53.        TTEESSTTBBIITTSS is free; anyone may redistribute copies of  TTEESSTT­­
  54.        BBIITTSS  to  anyone under the terms stated in the GNU General
  55.        Public Licence, a copy of which accompanies each  copy  of
  56.        TTEESSTTBBIITTSS.
  57.  
  58.        Torsten  Poulin encourages you to improve and extend TTEESSTT­­
  59.        BBIITTSS, and urges that you contribute your extensions to the
  60.        world.
  61.  
  62.  
  63.  
  64. TestBits version 37.1     11 March 1993                         1
  65.  
  66.  
  67.